<?php
include("function.php");
init_connect_db();
$title = $_POST['title'];
$article = $_POST['article'];
$userId = $_POST['userId'];
	$dateCreate = date("Y-m-d H:i:s");
	$temp = "INSERT INTO Places (id, title, article, dateCreate, dateEdit, Users_id) VALUES (NULL, '$title', '$article', '$dateCreate', '$dateCreate', '$userId')";
	$query = mysql_query($temp);
	if (!$query){
		printf('Could not execut the query');
		exit();
	}
        $query = mysql_query("SELECT title,id FROM Places");
	if (!$query) {
		printf('Could not execut the query');
		exit();
	}
        header('Location: ' . $_SERVER['HTTP_REFERER']);
?>